fix: Correct metadata parsing for forced playback speed#3836
Conversation
Fix an issue where ImprovedTube.speedException() is never called due to incorrect keyword retrieval. Exclude (name|itemprop) from capture groups to fix an index mismatch for property and value. Fix missing title updates from fetched content that cause the title to remain empty or outdated. Update regex to match "title" for extracting DATA.title from the fetched content.
|
nice! @hkzo thank you very much, we may combine as one function: I may help several future features and components, such as showing a video's tags or history, or archiving all available metadata always. ( And before fetching http...youtube it could check if API key is available (probably rare yet), ) DataYoutube category break down #1451 (temporarily offline as of #3804) There also is <meta property="og:video:width" content="1280" & height; |
hi @NazzzF good point (easy to predict too @ team) if you like to tell/ideas@improvedtube.com, what's your category break down and how many of the screenshots/timestamps would you like to publish too? |
Summary
This PR fixes metadata extraction in
ImprovedTube.playerPlaybackSpeed()when "Permanent/Forced playback speed" is enabled and the playback speed is set above 1.Video title changes were not always detected correctly because fetched metadata was parsed with a faulty regex.
Details
Fixed an issue where video title changes were not being correctly detected due to a faulty regex.
The subsequent logic expects property/value in
match[1]andmatch[2], but the current regex captures them intomatch[2]andmatch[3]. This mismatch causesif (keywords) { ImprovedTube.speedException(); }to always evaluate to false, preventing music video detection.Additionally, the code failed to extract the title from fetched content, leading to evaluations based on outdated metadata from the previous video.
Changes:
(name|itemprop)from capture groups to fix an index mismatch for property and value.<meat name="title">for extractingDATA.titlefrom the fetched content.ImprovedTube.speedException()is never triggered due to failed keyword retrieval.Environment